<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"flat"},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="相关链接阅读一个小时学会Git 重点 怎么进入具体的目录1234cd D:\GitRepository\GithubProject &#x2F;&#x2F; 目录位置d： 目录的盘符  或 D:	ls -a    ls: -F 给不同的文件添加不同表示,添加帽子 d&#x2F;   l*  &#x3D;s  -a: 显示隐藏文件  以.开头的文件 -p: 只给目录添加&#x2F; -t: 按照修改时间排序 time">
<meta property="og:type" content="article">
<meta property="og:title" content="Git的常用命令">
<meta property="og:url" content="http://yoursite.com/2020/03/13/Git/Git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/index.html">
<meta property="og:site_name" content="heweiliang blog">
<meta property="og:description" content="相关链接阅读一个小时学会Git 重点 怎么进入具体的目录1234cd D:\GitRepository\GithubProject &#x2F;&#x2F; 目录位置d： 目录的盘符  或 D:	ls -a    ls: -F 给不同的文件添加不同表示,添加帽子 d&#x2F;   l*  &#x3D;s  -a: 显示隐藏文件  以.开头的文件 -p: 只给目录添加&#x2F; -t: 按照修改时间排序 time">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-03-13T08:48:42.115Z">
<meta property="article:modified_time" content="2020-06-26T08:14:53.550Z">
<meta property="article:author" content="heweiliang">
<meta property="article:tag" content="Git">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/03/13/Git/Git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Git的常用命令 | heweiliang blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="heweiliang blog" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">heweiliang blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-schedule">

    <a href="/schedule/" rel="section"><i class="fa fa-fw fa-calendar"></i>日程表</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/yourname" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/03/13/Git/Git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="heweiliang">
      <meta itemprop="description" content="heweiliang blog">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="heweiliang blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Git的常用命令<a href="https://github.com/user-name/repo-name/tree/branch-name/subdirectory-name_posts/Git/Git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4.md" class="post-edit-link" title="编辑" rel="noopener" target="_blank"><i class="fa fa-pencil"></i></a>
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-03-13 16:48:42" itemprop="dateCreated datePublished" datetime="2020-03-13T16:48:42+08:00">2020-03-13</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-06-26 16:14:53" itemprop="dateModified" datetime="2020-06-26T16:14:53+08:00">2020-06-26</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Git/" itemprop="url" rel="index"><span itemprop="name">Git</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>5.3k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>5 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="相关链接阅读"><a href="#相关链接阅读" class="headerlink" title="相关链接阅读"></a>相关链接阅读</h2><p><a href="https://www.cnblogs.com/best/p/7474442.html" target="_blank" rel="noopener">一个小时学会Git</a></p>
<h2 id="重点-怎么进入具体的目录"><a href="#重点-怎么进入具体的目录" class="headerlink" title="重点 怎么进入具体的目录"></a>重点 <code>怎么进入具体的目录</code></h2><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> D:\GitRepository\GithubProject // 目录位置</span><br><span class="line">d： 目录的盘符  或 D:	</span><br><span class="line"></span><br><span class="line">ls -a</span><br></pre></td></tr></table></figure>



<p>ls: -F 给不同的文件添加不同表示,添加帽子</p>
<p>d/   l*  =s </p>
<p>-a: 显示隐藏文件  以.开头的文件</p>
<p>-p: 只给目录添加/</p>
<p>-t: 按照修改时间排序 time</p>
<p>   –time-style=long-iso: ls -l –time-style=long-iso  显示友好长格式时间</p>
<p>-r: 倒着排序 reverse</p>
<p>-S: 按照文件大小排序</p>
<p>-h: 以人类理解的范围显示</p>
<p>-i: 索引节点(inode==书的目录) print the index number of each file(内核根据此区别文件是否同一文件)</p>
<h2 id="基本配置"><a href="#基本配置" class="headerlink" title="基本配置"></a>基本配置</h2><p>Git配置 - git config</p>
<h4 id="查看配置"><a href="#查看配置" class="headerlink" title="查看配置"></a>查看配置</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config -l</span><br></pre></td></tr></table></figure>

<h4 id="查看不同级别的配置文件"><a href="#查看不同级别的配置文件" class="headerlink" title="查看不同级别的配置文件"></a>查看不同级别的配置文件</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#查看系统config</span></span><br><span class="line">git config --system --list</span><br><span class="line"></span><br><span class="line">http.sslcainfo=D:/Program Files/Git/Git/mingw64/ssl/certs/ca-bundle.crt</span><br><span class="line">http.sslbackend=openssl</span><br><span class="line">diff.astextplain.textconv=astextplain</span><br><span class="line">filter.lfs.clean=git-lfs clean -- %f</span><br><span class="line">filter.lfs.smudge=git-lfs smudge --skip -- %f</span><br><span class="line">filter.lfs.process=git-lfs filter-process --skip</span><br><span class="line">filter.lfs.required=<span class="literal">true</span></span><br><span class="line">credential.helper=manager</span><br><span class="line">　　</span><br><span class="line"><span class="comment">#查看当前用户（global）配置</span></span><br><span class="line">git config --global  --list</span><br><span class="line"></span><br><span class="line">use.email=15816073129@163.com</span><br><span class="line">user.name=coder</span><br><span class="line">user.email=15816073129@163.com</span><br><span class="line">color.ui=<span class="literal">true</span></span><br><span class="line">difftool.sourcetree.cmd=<span class="string">''</span> <span class="string">"<span class="variable">$LOCAL</span>"</span> <span class="string">"<span class="variable">$REMOTE</span>"</span></span><br><span class="line">mergetool.sourcetree.cmd=<span class="string">''</span></span><br><span class="line">mergetool.sourcetree.trustexitcode=<span class="literal">true</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">#查看当前仓库配置信息</span></span><br><span class="line">git config --<span class="built_in">local</span>  --list</span><br><span class="line"></span><br><span class="line">core.repositoryformatversion=0</span><br><span class="line">core.filemode=<span class="literal">false</span></span><br><span class="line">core.bare=<span class="literal">false</span></span><br><span class="line">core.logallrefupdates=<span class="literal">true</span></span><br><span class="line">core.symlinks=<span class="literal">false</span></span><br><span class="line">core.ignorecase=<span class="literal">true</span></span><br><span class="line">remote.origin.url=git@gitee.com:code-dream/CS-Xmind-Note.git</span><br><span class="line">remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*</span><br><span class="line">branch.master.remote=origin</span><br><span class="line">branch.master.merge=refs/heads/master</span><br></pre></td></tr></table></figure>

<h4 id="设置name和email"><a href="#设置name和email" class="headerlink" title="设置name和email"></a>设置name和email</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name <span class="string">"Your Name"</span></span><br><span class="line">git config --global user.email <span class="string">"email@example.com"</span></span><br><span class="line"></span><br><span class="line">git config --global user.name <span class="string">"coder"</span></span><br><span class="line">git config --global user.email <span class="string">"15816073129@163.com"</span></span><br></pre></td></tr></table></figure>

<h4 id="初始化仓库"><a href="#初始化仓库" class="headerlink" title="初始化仓库"></a>初始化仓库</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git init</span><br></pre></td></tr></table></figure>

<h4 id="仓库状态"><a href="#仓库状态" class="headerlink" title="仓库状态"></a>仓库状态</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git status</span><br></pre></td></tr></table></figure>

<h4 id="查看修改内容"><a href="#查看修改内容" class="headerlink" title="查看修改内容"></a>查看修改内容</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git diff &lt;file name&gt; //查看difference</span><br></pre></td></tr></table></figure>

<h4 id="把文件修改添加到暂存区"><a href="#把文件修改添加到暂存区" class="headerlink" title="把文件修改添加到暂存区"></a>把文件修改添加到暂存区</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git add readme.txt</span><br><span class="line">git add . //把文件添加到暂存区</span><br><span class="line">git commit -m <span class="string">"wrote a readme file"</span> //First modification 第一次修改</span><br></pre></td></tr></table></figure>

<h4 id="从版本库中删除该文件"><a href="#从版本库中删除该文件" class="headerlink" title="从版本库中删除该文件"></a>从版本库中删除该文件</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git rm test.txt</span><br></pre></td></tr></table></figure>

<h4 id="Git显示颜色"><a href="#Git显示颜色" class="headerlink" title="Git显示颜色"></a>Git显示颜色</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git config --global color.ui <span class="literal">true</span></span><br></pre></td></tr></table></figure>





<h2 id="版本管理"><a href="#版本管理" class="headerlink" title="版本管理"></a>版本管理</h2><h4 id="回退历史版本"><a href="#回退历史版本" class="headerlink" title="回退历史版本"></a>回退历史版本</h4><p><code>git log</code>可以查看提交历史，以便确定要<strong>回退到哪个版本</strong>。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git log</span><br><span class="line">git log --pretty&#x3D;oneline  &#x2F;&#x2F;输出信息太多，看得眼花缭乱的，可以试试加上--pretty&#x3D;oneline参数 漂亮 oneline 线上一线女装</span><br></pre></td></tr></table></figure>

<p><code>git reflog</code>查看命令历史，以便确定要<strong>回到未来的哪个版本</strong>。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git reflog</span><br><span class="line">git reflog --pretty=oneline</span><br></pre></td></tr></table></figure>

<h4 id="版本回退"><a href="#版本回退" class="headerlink" title="版本回退"></a>版本回退</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git reset --hard HEAD^  //下一个版本</span><br><span class="line">git reset --hard 版本号 //版本号不用写全</span><br><span class="line">// 很努力的重置</span><br><span class="line">reset 重置；清零</span><br><span class="line">hard  努力的；硬的；困难的</span><br></pre></td></tr></table></figure>

<blockquote>
<p>Git log 退出</p>
<p>英文状态下按Q</p>
</blockquote>
<h2 id="远程库管理"><a href="#远程库管理" class="headerlink" title="远程库管理"></a>远程库管理</h2><h4 id="配置SSH添加公钥（id-rsa-pub）到远程账号账号-id-rsa-id-rsa-pub-登陆文件"><a href="#配置SSH添加公钥（id-rsa-pub）到远程账号账号-id-rsa-id-rsa-pub-登陆文件" class="headerlink" title="配置SSH添加公钥（id_rsa.pub）到远程账号账号(id_rsa//id_rsa.pub) 登陆文件"></a>配置SSH添加公钥（id_rsa.pub）到远程账号账号(id_rsa//id_rsa.pub) 登陆文件</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">// 查看有没有公钥</span><br><span class="line"><span class="built_in">cd</span> ~/.ssh</span><br><span class="line">ls</span><br><span class="line">C:\Users\Administrator\.ssh\id_rsa.pub</span><br><span class="line">// 没有生成公钥</span><br><span class="line">ssh-keygen -t rsa -C <span class="string">"youremail@example.com"</span> </span><br><span class="line">1. ssh-keygen -t rsa -C <span class="string">"15816073129@163.com"</span> </span><br><span class="line">2. 输入密码</span><br><span class="line"></span><br><span class="line">验证是否成功，在git bash下输入</span><br><span class="line">ssh -T git@github.com</span><br><span class="line">接下来我们要做的就是把本地仓库传到github上去，在此之前还需要设置username和email，因为github每次commit都会记录他们</span><br><span class="line">$ git config --global user.name<span class="string">"your name"</span></span><br><span class="line"></span><br><span class="line">$ git config --global user.email<span class="string">"your_email@youremail.com"</span></span><br><span class="line"></span><br><span class="line">// 添加公钥到远程仓库</span><br></pre></td></tr></table></figure>

<h4 id="关联GitHub的远程库"><a href="#关联GitHub的远程库" class="headerlink" title="关联GitHub的远程库"></a>关联GitHub的远程库</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git remote add gitee git@gitee.com:code-dream/CS-Xmind-Note.git</span><br><span class="line">git@gitee.com:code-dream/CS-Xmind-Note.git</span><br></pre></td></tr></table></figure>

<h4 id="删除已有的GitHub远程库："><a href="#删除已有的GitHub远程库：" class="headerlink" title="删除已有的GitHub远程库："></a>删除已有的GitHub远程库：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote rm origin //git给远程库起的默认名称是`origin`</span><br></pre></td></tr></table></figure>

<h4 id="查看远程库信息："><a href="#查看远程库信息：" class="headerlink" title="查看远程库信息："></a>查看远程库信息：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote -v</span><br></pre></td></tr></table></figure>

<h4 id="同时关联Github和Gitee"><a href="#同时关联Github和Gitee" class="headerlink" title="同时关联Github和Gitee"></a>同时关联Github和Gitee</h4><p>关联GitHub的远程库：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote add github git@github.com:michaelliao/learngit.git</span><br></pre></td></tr></table></figure>

<p>关联Gitee的远程库：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote add gitee git@gitee.com:liaoxuefeng/learngit.git</span><br></pre></td></tr></table></figure>

<h4 id="查看远程库信息，可以看到两个远程库："><a href="#查看远程库信息，可以看到两个远程库：" class="headerlink" title="查看远程库信息，可以看到两个远程库："></a>查看远程库信息，可以看到两个远程库：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git remote -v</span><br><span class="line">gitee	git@gitee.com:liaoxuefeng/learngit.git (fetch)</span><br><span class="line">gitee	git@gitee.com:liaoxuefeng/learngit.git (push)</span><br><span class="line">github	git@github.com:michaelliao/learngit.git (fetch)</span><br><span class="line">github	git@github.com:michaelliao/learngit.git (push)</span><br></pre></td></tr></table></figure>

<p>如果要推送（上传）到GitHub，使用命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push github master</span><br></pre></td></tr></table></figure>

<p>如果要推送（上传）到Gitee，使用命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push gitee master</span><br></pre></td></tr></table></figure>

<h4 id="克隆"><a href="#克隆" class="headerlink" title="克隆"></a>克隆</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> 仓库地址</span><br></pre></td></tr></table></figure>



<h2 id="分支管理"><a href="#分支管理" class="headerlink" title="分支管理"></a>分支管理</h2><h4 id="上传"><a href="#上传" class="headerlink" title="上传"></a>上传</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push</span><br></pre></td></tr></table></figure>

<h4 id="拉取"><a href="#拉取" class="headerlink" title="拉取"></a>拉取</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull</span><br></pre></td></tr></table></figure>

<h4 id="查看分支："><a href="#查看分支：" class="headerlink" title="查看分支："></a>查看分支：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch //branch 分支</span><br></pre></td></tr></table></figure>

<h4 id="创建分支："><a href="#创建分支：" class="headerlink" title="创建分支："></a>创建分支：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch &lt;name&gt;</span><br></pre></td></tr></table></figure>

<h4 id="切换分支："><a href="#切换分支：" class="headerlink" title="切换分支："></a>切换分支：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git checkout &lt;name&gt; || git switch &lt;name&gt;</span><br></pre></td></tr></table></figure>

<h4 id="创建-切换分支："><a href="#创建-切换分支：" class="headerlink" title="创建+切换分支："></a>创建+切换分支：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git checkout -b &lt;name&gt;</span><br><span class="line">git switch -c &lt;name&gt;</span><br></pre></td></tr></table></figure>

<h4 id="合并某分支到当前分支："><a href="#合并某分支到当前分支：" class="headerlink" title="合并某分支到当前分支："></a>合并某分支到当前分支：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git merge &lt;name&gt; // merge 	合并, 融合, 并入</span><br></pre></td></tr></table></figure>

<h4 id="删除分支："><a href="#删除分支：" class="headerlink" title="删除分支："></a>删除分支：</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch -d &lt;name&gt;</span><br></pre></td></tr></table></figure>

<h4 id="强行删除分支"><a href="#强行删除分支" class="headerlink" title="强行删除分支"></a>强行删除分支</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch -D &lt;name&gt; //要先合并</span><br></pre></td></tr></table></figure>

<h4 id="查看分支合并图"><a href="#查看分支合并图" class="headerlink" title="查看分支合并图"></a>查看分支合并图</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">log</span> --graph // graph 图</span><br><span class="line">git <span class="built_in">log</span> --graph --pretty=oneline --abbrev-commit</span><br></pre></td></tr></table></figure>





<h2 id="标签管理"><a href="#标签管理" class="headerlink" title="标签管理"></a>标签管理</h2><h4 id="查找历史版本"><a href="#查找历史版本" class="headerlink" title="查找历史版本"></a>查找历史版本</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">//查找历史版本打标签 获取commit id值</span><br><span class="line">git <span class="built_in">log</span> --pretty=oneline --abbrev-commit</span><br></pre></td></tr></table></figure>

<h4 id="新建标签"><a href="#新建标签" class="headerlink" title="新建标签"></a>新建标签</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git tag &lt;tagname&gt;  //新建一个标签，默认为HEAD，也可以指定一个commit id；</span><br><span class="line">git tag &lt;tagname&gt; &lt;commit id&gt;</span><br><span class="line">git tag v0.9 f52c633// git tag 标签 commit id</span><br><span class="line">git tag v1.0</span><br></pre></td></tr></table></figure>

<h4 id="查看所有标签"><a href="#查看所有标签" class="headerlink" title="查看所有标签"></a>查看所有标签</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git tag</span><br></pre></td></tr></table></figure>

<h4 id="查看标签信息-标签不是按时间顺序列出，而是按字母排序的"><a href="#查看标签信息-标签不是按时间顺序列出，而是按字母排序的" class="headerlink" title="查看标签信息(标签不是按时间顺序列出，而是按字母排序的)"></a>查看标签信息(标签不是按时间顺序列出，而是按字母排序的)</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git show &lt;tagname&gt;</span><br><span class="line">git show v0.1</span><br></pre></td></tr></table></figure>

<h4 id="创建带有说明的标签"><a href="#创建带有说明的标签" class="headerlink" title="创建带有说明的标签"></a>创建带有说明的标签</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git tag -a &lt;tagname&gt; -m <span class="string">"标签信息"</span></span><br><span class="line">git tag -a v0.1 -m <span class="string">"version 0.1 released"</span> 1094adb //用-a指定标签名，-m指定说明文字 commit id是f52c633</span><br></pre></td></tr></table></figure>

<h4 id="推送一个本地标签；"><a href="#推送一个本地标签；" class="headerlink" title="推送一个本地标签；"></a>推送一个本地标签；</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push origin &lt;tagname&gt;</span><br></pre></td></tr></table></figure>

<h4 id="推送全部未推送过的本地标签；"><a href="#推送全部未推送过的本地标签；" class="headerlink" title="推送全部未推送过的本地标签；"></a>推送全部未推送过的本地标签；</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push origin --tags</span><br></pre></td></tr></table></figure>

<h4 id="删除一个本地标签；"><a href="#删除一个本地标签；" class="headerlink" title="删除一个本地标签；"></a>删除一个本地标签；</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git tag -d &lt;tagname&gt;</span><br></pre></td></tr></table></figure>

<h4 id="删除一个远程标签。（先删除本地标签，再到远程标签）"><a href="#删除一个远程标签。（先删除本地标签，再到远程标签）" class="headerlink" title="删除一个远程标签。（先删除本地标签，再到远程标签）"></a>删除一个远程标签。（先删除本地标签，再到远程标签）</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">// 删除本地标签</span><br><span class="line">git tag -d &lt;tagname&gt;</span><br><span class="line">//删除远程标签</span><br><span class="line">git push origin :refs/tags/v0.9</span><br></pre></td></tr></table></figure>









<p>查看远程库的远程主机</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git remote</span><br><span class="line">git remote -v</span><br><span class="line">origin  git@github.com:michaelliao/learngit.git (fetch)</span><br><span class="line">origin  git@github.com:michaelliao/learngit.git (push)</span><br><span class="line">//origin 远程分支名</span><br></pre></td></tr></table></figure>

<p>查看本地的分支信息</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git branch</span><br><span class="line">master</span><br></pre></td></tr></table></figure>

<p>怎么在远程仓库创建分支，直接在本地创建，然后push上去</p>
<p>上面显示了可以抓取和推送的<code>origin</code>的地址。如果没有推送权限，就看不到push的地址</p>
<h4 id="绑定远程分支"><a href="#绑定远程分支" class="headerlink" title="绑定远程分支"></a>绑定远程分支</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git branch --set-upstream branch-name origin&#x2F;branch-name</span><br></pre></td></tr></table></figure>

<h4 id="推送分支"><a href="#推送分支" class="headerlink" title="推送分支"></a>推送分支</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git push &lt;远程主机名&gt; &lt;本地分支名&gt;:&lt;远程分支名&gt;</span><br><span class="line">git push origin master</span><br><span class="line">git push origin dev	</span><br><span class="line">git push -u origin master</span><br></pre></td></tr></table></figure>



<h4 id="拉取分支"><a href="#拉取分支" class="headerlink" title="拉取分支"></a>拉取分支</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull &lt;远程主机名&gt; &lt;远程分支名&gt;:&lt;本地分支名&gt;</span><br></pre></td></tr></table></figure>



<p>解决failed to push some refs to git</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git pull --rebase origin master</span><br></pre></td></tr></table></figure>

<p> Git Push报错:remote: error: GH007: Your push would publish a private email address.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">公开自已的邮箱</span><br><span class="line"></span><br><span class="line">Gitee 将保密你的邮箱地址，并在执行基于 Web | WebIde 的 Git 操作中，使用 5000737+code-dream@user.noreply.gitee.com 作为你的邮箱地址。如果你希望命令行 Git 操作使用你的私人邮箱地址，你必须在 Git 中设置你的邮箱地址。</span><br></pre></td></tr></table></figure>

<p> 添加所有文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br></pre></td></tr></table></figure>

<p>.连接远程仓库</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote add origin https://github.com/kong/springcloud.git</span><br></pre></td></tr></table></figure>





<p>访问私有仓库是必须保证远程仓库中有你的ssh</p>
<p><a href="https://www.cnblogs.com/sunmingduo/p/10055329.html" target="_blank" rel="noopener">remote: Incorrect username or password ( access token ) fatal: Authentication failed for - 编程361 - 博客园</a></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">gitee推送到远程仓库时提示错误</span><br><span class="line">remote: Incorrect username or password ( access token )</span><br><span class="line">fatal: Authentication failed for &#39;https:&#x2F;&#x2F;gitee.com&#x2F;***&#x2F;***.git&#x2F;&#39;</span><br></pre></td></tr></table></figure>

<p>解决办法：清除本地的gitee用户名和密码</p>
<p>git config –system –unset credential.helper</p>
<p>再执行推送，重新输入用户名和密码。</p>

    </div>

    
    
    
        <div class="reward-container">
  <div></div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wechatpay.jpg" alt="heweiliang 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/alipay.jpg" alt="heweiliang 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Git/" rel="tag"># Git</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/03/13/Git/Git%E6%95%99%E7%A8%8B/" rel="prev" title="Git教程">
      <i class="fa fa-chevron-left"></i> Git教程
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/03/17/%E5%90%8E%E7%AB%AF/Java/BeautifulSoup/" rel="next" title="后端/Java/BeautifulSoup">
      后端/Java/BeautifulSoup <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    
  <div class="comments">
    <div id="lv-container" data-id="city" data-uid="MTAyMC81MDY1MC8yNzEzMw=="></div>
  </div>
  

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#相关链接阅读"><span class="nav-number">1.</span> <span class="nav-text">相关链接阅读</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#重点-怎么进入具体的目录"><span class="nav-number">2.</span> <span class="nav-text">重点 怎么进入具体的目录</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#基本配置"><span class="nav-number">3.</span> <span class="nav-text">基本配置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#查看配置"><span class="nav-number">3.0.1.</span> <span class="nav-text">查看配置</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看不同级别的配置文件"><span class="nav-number">3.0.2.</span> <span class="nav-text">查看不同级别的配置文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#设置name和email"><span class="nav-number">3.0.3.</span> <span class="nav-text">设置name和email</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#初始化仓库"><span class="nav-number">3.0.4.</span> <span class="nav-text">初始化仓库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#仓库状态"><span class="nav-number">3.0.5.</span> <span class="nav-text">仓库状态</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看修改内容"><span class="nav-number">3.0.6.</span> <span class="nav-text">查看修改内容</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#把文件修改添加到暂存区"><span class="nav-number">3.0.7.</span> <span class="nav-text">把文件修改添加到暂存区</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#从版本库中删除该文件"><span class="nav-number">3.0.8.</span> <span class="nav-text">从版本库中删除该文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Git显示颜色"><span class="nav-number">3.0.9.</span> <span class="nav-text">Git显示颜色</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#版本管理"><span class="nav-number">4.</span> <span class="nav-text">版本管理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#回退历史版本"><span class="nav-number">4.0.1.</span> <span class="nav-text">回退历史版本</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#版本回退"><span class="nav-number">4.0.2.</span> <span class="nav-text">版本回退</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#远程库管理"><span class="nav-number">5.</span> <span class="nav-text">远程库管理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#配置SSH添加公钥（id-rsa-pub）到远程账号账号-id-rsa-id-rsa-pub-登陆文件"><span class="nav-number">5.0.1.</span> <span class="nav-text">配置SSH添加公钥（id_rsa.pub）到远程账号账号(id_rsa&#x2F;&#x2F;id_rsa.pub) 登陆文件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#关联GitHub的远程库"><span class="nav-number">5.0.2.</span> <span class="nav-text">关联GitHub的远程库</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#删除已有的GitHub远程库："><span class="nav-number">5.0.3.</span> <span class="nav-text">删除已有的GitHub远程库：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看远程库信息："><span class="nav-number">5.0.4.</span> <span class="nav-text">查看远程库信息：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#同时关联Github和Gitee"><span class="nav-number">5.0.5.</span> <span class="nav-text">同时关联Github和Gitee</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看远程库信息，可以看到两个远程库："><span class="nav-number">5.0.6.</span> <span class="nav-text">查看远程库信息，可以看到两个远程库：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#克隆"><span class="nav-number">5.0.7.</span> <span class="nav-text">克隆</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#分支管理"><span class="nav-number">6.</span> <span class="nav-text">分支管理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#上传"><span class="nav-number">6.0.1.</span> <span class="nav-text">上传</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#拉取"><span class="nav-number">6.0.2.</span> <span class="nav-text">拉取</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看分支："><span class="nav-number">6.0.3.</span> <span class="nav-text">查看分支：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#创建分支："><span class="nav-number">6.0.4.</span> <span class="nav-text">创建分支：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#切换分支："><span class="nav-number">6.0.5.</span> <span class="nav-text">切换分支：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#创建-切换分支："><span class="nav-number">6.0.6.</span> <span class="nav-text">创建+切换分支：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#合并某分支到当前分支："><span class="nav-number">6.0.7.</span> <span class="nav-text">合并某分支到当前分支：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#删除分支："><span class="nav-number">6.0.8.</span> <span class="nav-text">删除分支：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#强行删除分支"><span class="nav-number">6.0.9.</span> <span class="nav-text">强行删除分支</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看分支合并图"><span class="nav-number">6.0.10.</span> <span class="nav-text">查看分支合并图</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#标签管理"><span class="nav-number">7.</span> <span class="nav-text">标签管理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#查找历史版本"><span class="nav-number">7.0.1.</span> <span class="nav-text">查找历史版本</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#新建标签"><span class="nav-number">7.0.2.</span> <span class="nav-text">新建标签</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看所有标签"><span class="nav-number">7.0.3.</span> <span class="nav-text">查看所有标签</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#查看标签信息-标签不是按时间顺序列出，而是按字母排序的"><span class="nav-number">7.0.4.</span> <span class="nav-text">查看标签信息(标签不是按时间顺序列出，而是按字母排序的)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#创建带有说明的标签"><span class="nav-number">7.0.5.</span> <span class="nav-text">创建带有说明的标签</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#推送一个本地标签；"><span class="nav-number">7.0.6.</span> <span class="nav-text">推送一个本地标签；</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#推送全部未推送过的本地标签；"><span class="nav-number">7.0.7.</span> <span class="nav-text">推送全部未推送过的本地标签；</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#删除一个本地标签；"><span class="nav-number">7.0.8.</span> <span class="nav-text">删除一个本地标签；</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#删除一个远程标签。（先删除本地标签，再到远程标签）"><span class="nav-number">7.0.9.</span> <span class="nav-text">删除一个远程标签。（先删除本地标签，再到远程标签）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#绑定远程分支"><span class="nav-number">7.0.10.</span> <span class="nav-text">绑定远程分支</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#推送分支"><span class="nav-number">7.0.11.</span> <span class="nav-text">推送分支</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#拉取分支"><span class="nav-number">7.0.12.</span> <span class="nav-text">拉取分支</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="heweiliang"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">heweiliang</p>
  <div class="site-description" itemprop="description">heweiliang blog</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">96</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">18</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">24</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/yourname" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i></a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:yourname@gmail.com" title="E-Mail → mailto:yourname@gmail.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i></a>
      </span>
      <span class="links-of-author-item">
        <a href="https://plus.google.com/yourname" title="Google → https:&#x2F;&#x2F;plus.google.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fa fa-fw fa-google"></i></a>
      </span>
      <span class="links-of-author-item">
        <a href="https://stackoverflow.com/yourname" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;yourname" rel="noopener" target="_blank"><i class="fa fa-fw fa-stack-overflow"></i></a>
      </span>
  </div>
  <div class="cc-license motion-element" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" rel="noopener" target="_blank"><img src="/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com">Title</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com">Title2</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com">Title3</a>
        </li>
    </ul>
  </div>

      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">heweiliang</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    <span title="站点总字数">376k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">5:42</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>


  <script defer src="/lib/three/three.min.js"></script>
    <script defer src="/lib/three/three-waves.min.js"></script>
    <script defer src="/lib/three/canvas_lines.min.js"></script>


  




  
<script src="/js/local-search.js"></script>













  

  

<script>
NexT.utils.loadComments(document.querySelector('#lv-container'), () => {
  window.livereOptions = {
    refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '')
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
});
</script>

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginModelPath":"assets/","model":{"jsonPath":"/live2dw/assets/Epsilon2.1.model.json"},"display":{"position":"left","width":300,"height":600},"mobile":{"show":false},"log":false,"pluginJsPath":"lib/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
